<template>
	<view>
		<CommentComponent v-if="index == 1"></CommentComponent>
		<LikeCollectComponent v-if="index == 2"></LikeCollectComponent>
		<FollowersComponent v-if="index==3"></FollowersComponent>
	</view>
</template>

<script>
import CommentComponent from '@/components/commentComponent/commentComponent.vue';
import LikeCollectComponent from '@/components/likeCollectComponent/likeCollectComponent.vue';
import FollowersComponent from '@/components/followersComponent/followersComponent.vue';
import index from '../../uni_modules/uview-ui';
import { mapState } from 'vuex';
export default {
	data() {
		return {
			index: 1, // 默认值
			title: ['评论和回复', '赞和收藏', '新增粉丝']
		};
	},
	computed: {
		    ...mapState(["isCommentsChange","isLikesChange",'isFansChange']), // 映射 Vuex 状态
		 },
	watch:{
		isCommentsChange(newVal, oldVal) {
			
		},
		isLikesChange(newVal, oldVal) {
			
		},
		isFansChange(newVal, oldVal) {
			
		}
	},
	onLoad(param) {
		this.index = param.index;
		uni.setNavigationBarTitle({
			title: this.title[param.index - 1]
		});
	},
	onShow() {
	    uni.setNavigationBarTitle({
	        title: this.title[this.index - 1] // 使用当前的 index
	    });
	},
	components: {
		CommentComponent,
		LikeCollectComponent,
		FollowersComponent
	}
};
</script>

<style scoped>

</style>
